package cn.kgc.tangcco.config;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 李昊哲
 * @Description
 * @create 2020/10/15 下午4:44
 */
public class ServletConfig02 extends HttpServlet {
    private static final long serialVersionUID = 6943724723312853888L;

    public ServletConfig02() {
        System.out.println("config02天之骄子");
    }

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("config02爱的轰轰烈烈");
    }

    @Override
    public void destroy() {
        System.out.println("config02挥一挥衣袖不带走一片云彩");
    }

    @Override
    public void init(ServletConfig config) throws ServletException {
        System.out.println("config02轻轻的我来了config");
        String lihaozhe = config.getInitParameter("lihaozhe");
        System.out.println("config02初始化的时候获取配置文件中的参数" +lihaozhe);
    }

    @Override
    public void init() throws ServletException {
        System.out.println("config02轻轻的我来了init");
    }
}
